/*
package com.example.demo.config;

import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.client.config.impl.LocalConfigInfoProcessor;
import com.alibaba.nacos.client.config.impl.ServerListManager;
import com.alibaba.nacos.common.executor.ThreadPoolManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class NacosConfigCustomizer {

//    private static final Logger logger = LoggerFactory.getLogger(NacosConfigCustomizer.class);

    @Bean
    public ConfigService customConfigService() {
        // 使用HttpSimpleClientHttpEngine作为HTTP客户端
        HttpSimpleClientHttpEngine httpEngine = HttpSimpleClientHttpEngineFactory.createDefaultHttpEngine();

        // 创建其他必要的组件
        ServerListManager serverListManager = new ServerListManager("localhost:8848");
        SnapshotCache snapshotCache = new SnapshotCache();
        LocalConfigInfoProcessor localConfigInfoProcessor = new LocalConfigInfoProcessor();
        ThreadPoolManager threadPoolManager = ThreadPoolManager.getInstance();

        // 创建RetryClient实例
        RetryClient retryClient = new RetryClient(httpEngine, serverListManager, snapshotCache, localConfigInfoProcessor, threadPoolManager);

        // 返回自定义的ConfigService实例
        return new ConfigService(retryClient);
    }
}
*/
